﻿// Decompiled with JetBrains decompiler
// Type: Microsoft.InfoCards.RequestSecurityTokenParameters
// Assembly: infocard, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 8E14765A-6610-409A-BA36-099A0642905D
// Assembly location: E:\git\ALLIDA\windll\infocard.exe

using Microsoft.InfoCards.Diagnostics;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Security.Cryptography.Xml;
using System.ServiceModel.Channels;

namespace Microsoft.InfoCards
{
  internal class RequestSecurityTokenParameters
  {
    private AddressingVersion m_addressingVersion;
    private GetBrowserTokenParameters m_browserTokenParams;
    private InfoCardPolicy m_policy;
    private InfoCard m_card;
    private bool m_discloseOptionalClaims;
    private RSAKeyValue m_rsaKeyValue;
    private byte[] m_clientEntropyForSymmetric;
    private CultureInfo m_cultureInfo;
    private string m_context;
    private Dictionary<string, bool> m_disclosedClaims;
    private ProtocolProfile m_profile;

    public AddressingVersion Version
    {
      get
      {
        return this.m_addressingVersion;
      }
    }

    public GetBrowserTokenParameters BrowserTokenParams
    {
      get
      {
        return this.m_browserTokenParams;
      }
    }

    public InfoCardPolicy Policy
    {
      get
      {
        return this.m_policy;
      }
    }

    public InfoCard Card
    {
      get
      {
        return this.m_card;
      }
    }

    public bool DiscloseOptionalClaims
    {
      get
      {
        return this.m_discloseOptionalClaims;
      }
    }

    public RSAKeyValue RSAKey
    {
      get
      {
        return this.m_rsaKeyValue;
      }
    }

    public byte[] ClientEntropyForSymmetric
    {
      get
      {
        return this.m_clientEntropyForSymmetric;
      }
    }

    public CultureInfo Culture
    {
      get
      {
        return this.m_cultureInfo;
      }
    }

    public string Context
    {
      get
      {
        return this.m_context;
      }
    }

    public Dictionary<string, bool> DisclosedClaims
    {
      get
      {
        return this.m_disclosedClaims;
      }
    }

    public ProtocolProfile Profile
    {
      get
      {
        return this.m_profile;
      }
    }

    public RequestSecurityTokenParameters(
      AddressingVersion version,
      InfoCard card,
      InfoCardPolicy policy,
      bool discloseOptionalClaims,
      RSAKeyValue rsaKeyValue,
      Dictionary<string, bool> disclosedClaims,
      string context,
      byte[] clientEntropyForSymmetric,
      CultureInfo displayCulture)
    {
      this.m_card = card;
      this.m_policy = policy;
      this.m_discloseOptionalClaims = discloseOptionalClaims;
      this.m_rsaKeyValue = rsaKeyValue;
      this.m_clientEntropyForSymmetric = clientEntropyForSymmetric;
      this.m_profile = policy.ProtocolVersionProfile;
      InfoCardTrace.Assert(this.m_rsaKeyValue == null && this.m_clientEntropyForSymmetric != null || this.m_rsaKeyValue == null && this.m_clientEntropyForSymmetric == null || this.m_rsaKeyValue != null && null == this.m_clientEntropyForSymmetric, "The three allowed cases are symmetric, noProofKey, asymmetric");
      this.m_disclosedClaims = disclosedClaims;
      this.m_addressingVersion = version;
      this.m_context = context;
      this.m_cultureInfo = displayCulture;
    }

    public RequestSecurityTokenParameters(
      AddressingVersion addressing,
      GetBrowserTokenParameters parameters,
      ProtocolProfile profile,
      InfoCardPolicy policy,
      bool discloseOptionalClaims)
    {
      this.m_browserTokenParams = parameters;
      this.m_addressingVersion = addressing;
      this.m_policy = policy;
      this.m_discloseOptionalClaims = discloseOptionalClaims;
      this.m_context = Guid.NewGuid().ToString();
      this.m_profile = profile;
    }
  }
}
